package ptumall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ptumall.service.HotKeywordService;
import ptumall.utils.ApiResponse;

import java.util.List;

@RestController
@RequestMapping("/api/keyword")
public class HotKeywordController {
    @Autowired
    private HotKeywordService hotKeywordService;
    //热点关键词
    @GetMapping("/hot")
    public ApiResponse<List<String>> getHotKeywords(@RequestParam int top) {
        return ApiResponse.success(hotKeywordService.getHotKeywords(top));
    }
}
